flat assembler
Message board for the users of flat assembler.

Index > Heap > is floating, decimal necessary?

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 8904
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
if a division would break a number into decimal, does it make it a number still?

3/9 = 0.333333333

if 1 cm = 10mm
and 0.1cm = 1mm

then why the need of decimal, we could just invent another "type" that basically x10, x1000, x100000

or the exists of decimal is mainly to cater for division?
Post 22 Jun 2011, 03:50
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
well, .05 is not 5.00 is it?
Post 22 Jun 2011, 07:40
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
That's exactly what "floating point number" is. It consists of two whole numbers: Exponent, which is the "floating" decimal point (Eg. x10, x1000, x100000), and mantissa. So for example, 15.356 is 15356e-3, eg. mantissa 15356 and exponent -3 (but of course this is in binary, not decimal).
Post 22 Jun 2011, 07:41
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.