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



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

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

  value.abs
end

.ceil(value) ⇒ Object

Deprecated.

Use Float#ceil instead

round upwards to integer



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

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



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

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

  value.floor.to_f
end

.pow(base, power) ⇒ Object

Deprecated.

Use Float#** instead

power function



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

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



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

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

  value.to_i.to_f
end