According to the Borland user manual (which implements floats the same
as mspgcc), a 32bit float has this range:
3.4x10^-38 to 3.4x10^38 with 7-digit precision.
And after googling, I found this doc which more accurately states the
precision to be 7.22 digits.
http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html
A good description of how it works can be found here:
http://www.engr.usask.ca/~mjr347/prog/geoe314/geoe314.005b.html#float
-Mark


-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net
[mailto:mspgcc-users-ad...@lists.sourceforge.net] On Behalf Of Ricardo
H. Wiggers
Sent: Wednesday, February 12, 2003 10:06 AM
To: mspgcc-users@lists.sourceforge.net
Subject: Re: [Mspgcc-users] Double data type?


Correct me if i´m wrong.
Using 32bit long as fixed point (Q31) I could reach a range from -1 to
0,9999999995 (=1-2^-31), wich seems to satisfy the specification.

Bye,
Ricardo

----- Original Message -----
From: "Bill Knight" <bi...@rosw.com>
To: <mspgcc-users@lists.sourceforge.net>
Sent: Wednesday, February 12, 2003 10:32 AM
Subject: Re: [Mspgcc-users] Double data type?


> This got me thinking (warning).  Looks like values can range from
> 0.00000000 to 99999999.  What about using 'long long's?  I think
> that should cover the range.  Would someone remind me, does mspgcc
> have long long support?
>
> Anyway, just a thought.
>
> -Bill Knight
> R O SoftWare
>
>
> On Wed, 12 Feb 2003 08:16:15 -0500 (EST), Thomas Carley wrote:
>
> >Would a fixed point representation work well here? If you use base 2
> >(binary fixed point) it is very efficient. What is the range of data
you
> >need to represent, and with what precision?
>
> >On Wed, 12 Feb 2003, Dmitry wrote:
>
> >> 64bits doubles are not supported.
> >> I have no plans to make this support.
> >>
> >> only 32bits IEEE754 floats are (somehow) suported.
> >>
> >> ~d
> >>
> >>
> >> On Wednesday 12 February 2003 00:17, Mark Stokes wrote:
> >> > What happened to the double data type that was discussed earlier.
I
> >> > have found a need for it and was wondering.  Here's my dilemma:
> >> > I am using 8-digit 7-seg display to represent things on the
screen.
> >> > This means that if I want to represent a floating point number
that
is
> >> > less than one like 0.9999999 I would have a number that is out of
the
> >> > bounds of the "float" data type.  For example:
> >> >
> >> > float floatvar;
> >> >
> >> >     floatvar = 0.99999999
> >> >
> >> > Then floatvar ends up == 1 which is not helping me.  I need it to
==
> >> > .99999999 because internally the controller can't deal w/ numbers
(in
> >> > this particular variable) that are >= 1.0.
> >> > However, if I take the same code and put on Borland, and use
"double's",
> >> > then I get the intended result (floatvar ends up == to
0.99999999).
> >> > {footnote: if I use float in Borland the same thing happens.}
> >> >
> >> > Any ideas on when "double" will be available?  What about a new
release
> >> > of the win32 executables?  Perhaps I'll get the gnu tree working
so
that
> >> > I can make win32 releases, but right now I don't have the time to
mess
> >> > w/ that.
> >> >
> >> > Thanks
> >> > -Mark
> >> >
> >> >
> >> >
> >> > -------------------------------------------------------
> >> > This SF.NET email is sponsored by:
> >> > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2
See!
> >> > http://www.vasoftware.com
> >> > _______________________________________________
> >> > Mspgcc-users mailing list
> >> > Mspgcc-users@lists.sourceforge.net
> >> > https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> >>
> >> --
> >>
/********************************************************************
> >>      ("`-''-/").___..--''"`-._     (\   Dimmy the Wild      UA1ACZ
> >>       `6_ 6  )   `-.  (     ).`-.__.`)  Enterprise Information Sys
> >>       (_Y_.)'  ._   )  `._ `. ``-..-'   Nevsky prospekt,   20 / 44
> >>     _..`--'_..-_/  /--'_.' ,'           Saint Petersburg,   Russia
> >>    (il),-''  (li),'  ((!.-'             +7 (812)  3468202, 5585314
> >>
********************************************************************/
> >>
> >>
> >>
> >> -------------------------------------------------------
> >> This SF.NET email is sponsored by:
> >> SourceForge Enterprise Edition + IBM + LinuxWorld
http://www.vasoftware.com
> >> _______________________________________________
> >> Mspgcc-users mailing list
> >> Mspgcc-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> >>
>
>
>
> >-------------------------------------------------------
> >This SF.NET email is sponsored by:
> >SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> >http://www.vasoftware.com
> >_______________________________________________
> >Mspgcc-users mailing list
> >Mspgcc-users@lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to