[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

converting a signed float into unsigned float

Dipesh Batheja

11/15/2006 3:17:00 PM

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.

--
Posted via http://www.ruby-....

2 Answers

Jeff Schwab

11/15/2006 3:25:00 PM

0

Dipesh Batheja 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

Bernard Kenik

11/16/2006 7:30:00 PM

0


----- Original Message -----
From: "Dipesh Batheja" <dipesh_batheja@yahoo.com>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
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