electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
float x --> not a number?
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [6 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Nov 15, 2006 10:49 am    Post subject: float x --> not a number? Reply with quote  Mark this post and the followings unread

i've just checked out more functions from the manual today..
and now i'm wondering what..
[ function ] int isnan ( float x )
is x ”not a number”?
.. is for.

what x can be not-a-number?
do you have any examples?
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
ge



Joined: Aug 13, 2006
Posts: 108
Location: Palo Alto, CA

PostPosted: Wed Nov 15, 2006 11:19 am    Post subject: Re: float x --> not a number? Reply with quote  Mark this post and the followings unread

kijjaz wrote:

what x can be not-a-number?
do you have any examples?


Here is an example that shows some ways to get "illegal" floats:

http://chuck.cs.princeton.edu/doc/examples/basic/infnan.ck
Back to top
View user's profile Send private message Visit poster's website
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Thu Nov 16, 2006 1:59 am    Post subject: Reply with quote  Mark this post and the followings unread

oh! it's there in the example!
thanks!..
this is totally cool!
me loves 0/0..

music with 0/0 timesignature is cool as well.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Thu Nov 16, 2006 4:24 am    Post subject: Reply with quote  Mark this post and the followings unread

oh i have another issue..
<<< 0.0 / 0.0 >>>; // works fine (not a number)
<<< 1.0 / 0.0 >>>; // works fine (infinity)
<<< 1 / 0.0, 0 / 0.0 >>>; // works fine also.
but 1 / 0 and 0 / 0 both kill ChucK..
i know we should test before dividing,
but should it kills the shred instead of killing the running chuck?
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
ge



Joined: Aug 13, 2006
Posts: 108
Location: Palo Alto, CA

PostPosted: Thu Nov 16, 2006 6:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

kijjaz wrote:

but 1 / 0 and 0 / 0 both kill ChucK..
i know we should test before dividing,
but should it kills the shred instead of killing the running chuck?

That is a bug! We need to catch those integer divide by zero!

Thanks for finding this. Also for the great work in tracking down other weirdness. We are planning a big round of bug hunt!!
Back to top
View user's profile Send private message Visit poster's website
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Fri Nov 17, 2006 2:04 am    Post subject: Reply with quote  Mark this post and the followings unread

cool. i'll try to hunt some more down as i keep chucking along ^_^.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [6 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use