MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Re: bug in IntegerPart ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47837] RE: [mg47809] Re: bug in IntegerPart ?
  • From: "DrBob" <drbob at bigfoot.com>
  • Date: Thu, 29 Apr 2004 00:34:13 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

2^^BaseForm[0.35`, 2] WOULD be a legitimate expression, if Help were correct
in saying that BaseForm is a wrapper, affecting printing but not evaluation.

DrBob

www.eclecticdreams.net


-----Original Message-----
From: Bill Rowe [mailto:readnewsciv at earthlink.net] 
To: mathgroup at smc.vnet.net
Subject: [mg47837] [mg47809] Re: bug in IntegerPart ?

On 4/26/04 at 2:41 AM, ancow65 at yahoo.com (AC) wrote:

>"DrBob" <drbob at bigfoot.com> wrote in message
>news:<c6g015$4lk$1 at smc.vnet.net>...
>>There's NO reason to be puzzled. 1.65 and 1.3 can't be represented
>>exactly in binary, so of course their difference may not be exact,
>>either. Hence the division problems have different numerators.
>
>Your 'explanation' makes no sense whatsoever. Mathematica's binary
>representations of 1.65-1.3 and 0.35 are the same. That can be seen
>by comparing BaseForm[1.65 - 1.3, 2] with BaseForm[0.35,2]

BaseForm isn't doing what you think and will not show the difference.
BaseForm controls only the display of a number. By default Mathematica
displays a number to 6 significant digits. Both 1.65 - 1.3 and .35 are the
same to 6 significant digits. Consequently, these will display the same when
using BaseForm.

To see the difference use RealDigits or FullForm. Both of these clearly show
the difference between 1.65 - 1.3 and .35.

>(n = 2^^0.010110011001100110011 )
> => 0.350000

Right, here you've inputed a number accurate to 6 significant digits. So,
Mathematica displays 6 significant digits

> Notice the unussual display of trailing zeros. 

No, not unusual. Exactly as it should be. If I input 6 significant digits as

.35`6, I expect Mathematica to display 6 significant digits with the default
settings.

>Additionally, a completely legitimate expression
>2^^BaseForm[0.35`, 2]
>produces a syntax error message.

The expression 2^^BaseForm[0.35, 2] isn't a legitimate expression. BaseForm
puts a wrapper on the expression to control display. That is
Head at BaseForm[0.35, 2] is BaseForm, not a sequence of binary digits.

--
To reply via email subtract one hundred and four




  • Prev by Date: Simplify expressions
  • Next by Date: Re: Question on pattern matching
  • Previous by thread: Re: Re: bug in IntegerPart ?
  • Next by thread: Re: bug in IntegerPart ?