Module: Yast::Builtins::Float Deprecated

Defined in:
src/ruby/yast/builtins.rb

Overview

Deprecated.

all calls are deprecated

builtins enclosed at Float namespace

Class Method Summary collapse

Class Method Details

.abs(value) ⇒ Object

Deprecated.

Use Float#abs instead

absolute value



260
261
262
263
264
# File 'src/ruby/yast/builtins.rb', line 260

def self.abs(value)
  return nil if value.nil?

  value.abs
end

.ceil(value) ⇒ Object

Deprecated.

Use Float#ceil instead

round upwards to integer



268
269
270
271
272
# File 'src/ruby/yast/builtins.rb', line 268

def self.ceil(value)
  return nil if value.nil?

  value.ceil.to_f
end

.floor(value) ⇒ Object

Deprecated.

Use Float#floor instead

round downwards to integer



276
277
278
279
280
# File 'src/ruby/yast/builtins.rb', line 276

def self.floor(value)
  return nil if value.nil?

  value.floor.to_f
end

.pow(base, power) ⇒ Object

Deprecated.

Use Float#** instead

power function



284
285
286
287
288
# File 'src/ruby/yast/builtins.rb', line 284

def self.pow(base, power)
  return nil if base.nil? || power.nil?

  base**power
end

.trunc(value) ⇒ Object

Deprecated.

Use Float#to_i instead

round to integer, towards zero



292
293
294
295
296
# File 'src/ruby/yast/builtins.rb', line 292

def self.trunc(value)
  return nil if value.nil?

  value.to_i.to_f
end