Converting a signed float into unsigned float

I know this is simple, but i am unable to find how to do this. I have an
floating number and i want to convert it to unsigned floating number.
What do i have t do.

Dipesh B. wrote:

I know this is simple, but i am unable to find how to do this. I have an
floating number and i want to convert it to unsigned floating number.
What do i have t do.

irb(main):001:0> (-3.14).abs
=> 3.14
irb(main):002:0> 2.7.abs
=> 2.7

----- Original Message -----
From: “Dipesh B.” [email protected]
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” [email protected]
Sent: Wednesday, November 15, 2006 10:17 AM
Subject: converting a signed float into unsigned float

I know this is simple, but i am unable to find how to do this. I have an
floating number and i want to convert it to unsigned floating number.
What do i have t do.

fl_num = -1.456
fl_num = fl_num.abs

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs