|
Re: Combination [message #75400 is a reply to message #75399] |
Mon, 28 February 2011 13:40  |
fgg
Messages: 67 Registered: April 2010
|
Member |
|
|
Hi David,
I guess so. I love the melodrama in the opening paragraph, btw :) ... just hope I didn't sound like that.
round(c) it is!
Thanks again.
|
|
|
Re: Combination [message #75401 is a reply to message #75400] |
Mon, 28 February 2011 13:12  |
Carsten Lechte
Messages: 124 Registered: August 2006
|
Senior Member |
|
|
fgg wrote:
> IDL> c = factorial(21)/(factorial(3)*factorial(21-3))
> IDL> print, c
> 1330.0000
WYSINWYG (what you see is NOT what you get):
IDL> print, c, format='(D50)'
1329.9999999999995453
IDL> print, LONG(c)
1329
HTH, chl
|
|
|
Re: Combination [message #75402 is a reply to message #75401] |
Mon, 28 February 2011 13:02  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
fgg writes:
> I should probably know this by now... what's going on below?
>
> IDL> c = factorial(21)/(factorial(3)*factorial(21-3))
> IDL> print, c
> 1330.0000
> IDL> myvec = dblarr(c)
> IDL> help, myvec
> MYVEC DOUBLE = Array[1329]
>
> I'd like myvec to have 1330 elements... not 1329.
I would guess yet another instance of the "Sky is Falling." :-)
http://www.idlcoyote.com/math_tips/sky_is_falling.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|