Comparing two long numbers  
Author Message
Andreas Leitgeb





PostPosted: 2008-6-4 3:34:00 Top

java-programmer, Comparing two long numbers John B. Matthews <email***@***.com> wrote:
>> 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?

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?
 
Andreas Leitgeb





PostPosted: 2008-6-4 3:34:00 Top

java-programmer >> Comparing two long numbers John B. Matthews <email***@***.com> wrote:
>> 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?

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?
 
John B. Matthews





PostPosted: 2008-6-4 6:46:00 Top

java-programmer >> Comparing two long numbers In article <email***@***.com>,
Andreas Leitgeb <email***@***.com> wrote:

> John B. Matthews <email***@***.com> wrote:
> >> 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?
>
> 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
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
 
 
Lew





PostPosted: 2008-6-4 12:11:00 Top

java-programmer >> Comparing two long numbers Andreas Leitgeb wrote:
>> 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.

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.

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.

--
Lew