Comparing two long numbers

T

Tom Anderson

Ah, right, the old abbreviation for pence was "d". Damn.

But one quarter is 1/4: decimalisation don't enter into it. Not unless
you state 1/4 = 0.25.

The point is that on decimalisation, the letter for 'penny' changed (as
did the value of the coin) - the pre-decimal penny is d, the decimal penny
is p. 1p/4 would be a quarter of a decimal penny, a denomination which has
never existed.

tom
 
D

Daniele Futtorovic

The point is that on decimalisation, the letter for 'penny' changed (as
did the value of the coin) - the pre-decimal penny is d, the decimal
penny is p. 1p/4 would be a quarter of a decimal penny, a denomination
which has never existed.

I see. Thanks for the clarification.
 
A

Arne Vajhøj

Daniele said:
double athird = 1d / 3; ?

Granted, "1." would be the same. But haven't you ever encountered it?

I am sure that I would use 1.0, but out of all the Java developers
there has to be some that prefer 1d.

Arne
 
J

John B. Matthews

Andreas Leitgeb said:
Why final, anyway? As if the eye were never to move... :)

It was an internal proportion for rendering a component that filled its
container. The container was responsible for assuming a pleasing aspect.

John
 
A

Andreas Leitgeb

John B. Matthews said:
It was an internal proportion for rendering a component that filled its
container. The container was responsible for assuming a pleasing aspect.

Perhaps, 0.61803398875 would have been even more pleasing than 0.7 :)
 
J

John B. Matthews

Andreas Leitgeb said:
Perhaps, 0.61803398875 would have been even more pleasing than 0.7 :)

Yes, but surely you mean 2 / (1 + Math.sqrt(5d))! Clearly there is an
immanent need for Math.PHI :)

John
 
A

Andreas Leitgeb

John B. Matthews said:
Yes, but surely you mean 2 / (1 + Math.sqrt(5d))! Clearly there is an
immanent need for Math.PHI :)

I meant (Math.sqrt(5.)-1)/2, which is theoretically the same, but
numerically more stable, since the divisor is simpler.
But then it would be Math.PHI, and at least as exact as each of the
formulae, if not better than both. :)
 
J

John B. Matthews

Andreas Leitgeb said:
I meant (Math.sqrt(5.)-1)/2, which is theoretically the same, but
numerically more stable, since the divisor is simpler.
But then it would be Math.PHI, and at least as exact as each of the
formulae, if not better than both. :)

You're right: I inverted but didn't simplify! But isn't
(Math.sqrt(5.)-1)/2 equal to 1 / phi?

John
 
A

Andreas Leitgeb

John B. Matthews said:
You're right: I inverted but didn't simplify! But isn't
(Math.sqrt(5.)-1)/2 equal to 1 / phi?

IIRC, PHI is the one with a "1" before the decimal point, so, yes,
your aspect ration was near 1/PHI actually. The other solution
of "x = 1/x + 1" is -1/PHI (-0.618...)

Just hold the height fixed, and make the width of your component
<wish>Math.PHI</wish> times longer. Or if really the width is
given, then make the height a PHI'th.

PS: I think we should think about ending this subthread, shouldn't we?
 
J

John B. Matthews

Andreas Leitgeb said:
IIRC, PHI is the one with a "1" before the decimal point, so, yes,
your aspect ration was near 1/PHI actually. The other solution
of "x = 1/x + 1" is -1/PHI (-0.618...)

Just hold the height fixed, and make the width of your component
<wish>Math.PHI</wish> times longer. Or if really the width is
given, then make the height a PHI'th.

That was arranged at the Container level; the Component filled the
Container and used the 7 / 10 ratio internally, but not for framing.
PS: I think we should think about ending this subthread, shouldn't we?

I defer to you for a final word.

John
 
A

Andreas Leitgeb

You wish that a PHIth of the width were the height,
or were the width the PHIth, that, too, would delight?
Piththed-off, you cry that that can't be,
they gave us PI, but left out PHI.

So, "PHI" in english still rhymes with "be"? I feared it rhymed
with "by", just like the english pronunciation of circular PI.

For me, I pronounce it like fee, as it rhymes with the glee
of viewing a perfectly shaped rectangle. (No rhyme here, u c?)
The Greek also say "π" and "φ", ahem, "pee" and "fee".

And while we're at proposing new constants, me and you:
add to java.lang.Math: static final int ANSWER = 42;
You can static final the computation for PHI in your own class, but
Math.sqrt() is not part of a compile-time constant expression, alas.

You can calculate it to an exceeding number of places with some other tool,
and add it decimally to your class's constant pool.
1.618033988749894848204586834365... (some extra digits are cool!)
 
T

Tom Anderson

So, "PHI" in english still rhymes with "be"? I feared it rhymed
with "by", just like the english pronunciation of circular PI.

Lew is, to matters phonetic, applying his license poetic. The Englishman's
phi rhymes with his eye - but here, that was not aesthetic.

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
VinayKumar Nevatia
Top