Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #69720

Re: routine for angles needed

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: routine for angles needed
Date 2015-09-06 18:30 -0700
Organization None to speak of
Message-ID <ln7fo3t3qt.fsf@kst-u.example.com> (permalink)
References (10 earlier) <mpr00v$1hn$1@speranza.aioe.org> <7oa3sapt6r9q23hicbp2tpafqg3rjl98do@4ax.com> <kfnr3mcww4j.fsf@x-alumni2.alumni.caltech.edu> <lntwr8v48u.fsf@kst-u.example.com> <kfn4mj7ox8n.fsf@x-alumni2.alumni.caltech.edu>

Show all headers | View raw


Tim Rentsch <txr@alumni.caltech.edu> writes:
> Keith Thompson <kst-u@mib.org> writes:
>> Tim Rentsch <txr@alumni.caltech.edu> writes:
>>> Robert Wessel <robertwessel2@yahoo.com> writes:
>>
>> [...]
>>
>>>> Ultimately any sort of decimal encoding has to be less efficient than
>>>> binary encoding, since you invariably end up with "invalid" bit
>>>> patterns.  [snip]
>>>
>>> This isn't right.  Using a decimal base for floating point
>>> is not inherently less bit efficient than a binary base.
>>> Using a decimal base can be much less convenient than
>>> using a binary base, but it is not inherently less bit
>>> efficient.  In particular there needn't be any invalid
>>> or duplicate bit patterns.
>>
>> As sometimes happens, I suspect you're talking about something
>> subtle that I haven't thought of.  [snip]
>
> Here is an example scheme for 16 bits.  We use one bit
> for the sign, which leaves 15 bits.  Think of those 15
> bits as an unsigned number N.
>
> If N is zero, the value is 0.0.
>
> If N is greater than zero, we get three normalized decimal digits
> by taking (N-1) % 900 + 100, and putting the decimal point on
> the left.  So that is a value between 0.100 and 0.999, inclusive.
> We get a decimal exponent value by taking (N-1)/900 - 17.  These
> two taken together give a range of 1.00e-18 to 3.66e+18, assuming
> I've done my arithmetic correctly.  Every value has a unique
> representation (not counting negative zero, which is a special
> case), and there are no wasted codes.  Obviously we could cadge
> a few values out of the high end for NaNs or infinity if we
> wanted to, but that is a minor detail.
>
> Is this clear enough, or is more explanation needed?

So you're talking about a representation that partitions the 15
bits into a significand and an exponent, but the boundary is not
on a bit boundary.  An interesting idea, though I'm not at all sure
how practical it is.

In any case, if that's what you had in mind, just saying that
"Using a decimal base for floating point is not inherently less
bit efficient than a binary base" gives the impression that you
were being deliberately vague.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 10:17 -0700
  Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-02 10:38 -0700
    Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 11:10 -0700
      Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-02 11:26 -0700
        Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 11:41 -0700
          Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:02 -0700
  Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-02 18:41 +0100
    Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 11:43 -0700
      Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-02 20:00 +0100
        Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:04 -0700
          Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:10 -0700
            Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:24 -0700
              Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-02 12:32 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-02 20:40 +0100
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:59 -0700
                Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-02 13:14 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 13:39 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 13:45 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-03 07:48 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-03 17:06 +0100
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-03 09:09 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-03 09:17 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-03 17:48 +0100
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-08-03 13:44 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-03 23:51 +0100
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-08-03 18:30 -0700
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-03 23:11 +0000
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-04 01:32 +0100
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-04 01:14 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-03 20:26 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-04 18:24 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-05 01:46 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-05 18:06 +0000
                Re: routine for angles needed Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 11:37 -0700
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-09-05 16:24 -0700
                Re: routine for angles needed Richard Damon <Richard@Damon-Family.org> - 2015-09-05 21:01 -0400
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-09-05 23:30 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-06 05:37 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-09-07 00:27 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-06 05:31 +0000
                Re: routine for angles needed James Kuyper <jameskuyper@verizon.net> - 2015-09-06 11:57 -0400
                Re: routine for angles needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-06 17:44 +0100
                Re: routine for angles needed James Kuyper <jameskuyper@verizon.net> - 2015-09-06 14:02 -0400
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-12 00:05 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-09-07 00:31 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-12 00:00 +0000
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-11 23:17 +0000
                Re: routine for angles needed James Kuyper <jameskuyper@verizon.net> - 2015-09-11 19:46 -0400
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-12 03:56 +0000
                Re: routine for angles needed James Kuyper <jameskuyper@verizon.net> - 2015-09-12 12:33 -0400
                Re: routine for angles needed Richard Damon <Richard@Damon-Family.org> - 2015-09-12 14:29 -0400
                Re: routine for angles needed James Kuyper <jameskuyper@verizon.net> - 2015-09-12 15:58 -0400
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-13 06:21 +0000
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-09-06 11:59 -0700
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-12 00:16 +0000
                Re: routine for angles needed Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 18:04 -0700
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-09-06 18:30 -0700
                Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-06 18:48 -0700
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-09-07 00:44 -0500
                Re: routine for angles needed Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-10 05:44 -0700
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-12 00:25 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-03 20:16 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-04 01:26 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-05 02:05 -0500
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-08-03 18:33 -0700
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-04 21:24 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-03 19:41 -0500
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:51 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:56 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-02 20:57 +0100
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 13:06 -0700
                Re: routine for angles needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-02 22:25 +0100
                Re: routine for angles needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-02 22:27 +0100
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 14:40 -0700
  Re: routine for angles needed "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-08-02 19:08 -0700
    Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-03 02:18 -0700
  Re: routine for angles needed danncorbit@gmail.com - 2015-08-12 02:18 -0700
  Re: routine for angles needed bartekltg <bartekltg@gmail.com> - 2015-09-07 05:02 +0200

csiph-web