Re: Fast extraction of fraction part from float.



"Friar Broccoli" <EliasRK@xxxxxxxxx> writes:

> Phil Carmody wrote:
> > "Friar Broccoli" <EliasRK@xxxxxxxxx> writes:
> > > Hello World;
> > >
> > > I need to extract the fraction part from floats for a script I
> > > am working on in my text editor (TSE). The scripting language
> > > does NOT include floating point ops, however it does include
> > > binary ops like shifting, AND, OR, XOR etc.
> >
> > If the scripting language does not include floating point ops,
> > then how does it

'it' being the scripting language

> > represent the floats whose fractional part you
> > want to extract?
>
> There are several answers to this question depending on the context.
>
> In my current situation most dates within Windows are represented as
> floating point numbers (usually doubles). The whole part is a count
> of the
> days since Dec 31, 1899, and the fraction part is the time, where for
> example: .1 binary is 12:00:00; .11 is 18:00:00; .01 is 06:00:00 etc
>
> So for this case the answer is that I will be representing the
> fractional
> part as a time of day

You are not a scripting language. You are a free man.

Your response really didn't answer my question. Too bad.

Phil
--
What is it: is man only a blunder of God, or God only a blunder of man?
-- Friedrich Nietzsche (1844-1900), The Twilight of the Gods
.



Relevant Pages

  • Re: Fast extraction of fraction part from float.
    ... >> I need to extract the fraction part from floats for a script I ... > If the scripting language does not include floating point ops, ...
    (alt.lang.asm)
  • Re: Floating point questions
    ... Packed decimal is definitely of IBM origin, but was fully supported on VAXn ... IIRC to convert from integer to floating, ... IBM floating point has a binary fraction and a base 16 exponent. ... typically include language support for decimal-scaled packed decimal ...
    (comp.os.vms)
  • Re: BASH question
    ... |> Fractional parts is not the same as floating point. ... fraction point if a base other than 10). ... a fixed point value will always have the same precision but a limit ... digits of storage for the number we could represent all values from 0.00 to ...
    (Fedora)
  • Re: Avoiding floating points
    ... "Add Fixed and Floating Decimal Point Numbers to Delphi" ... fraction numbers. ... And if you do allow for rounding the result into a ... then you need to specify or know what ...
    (borland.public.delphi.non-technical)
  • Re: typecast internals
    ... Here a floating point number ... The "f"s here represent fraction bits. ... At the CPU instruction level, ... In this case, with the working fraction initially 0.375, we have: ...
    (comp.lang.c)