Open paulfitz opened 10 years ago
Also, this is needed to facilitate division. I thought about introducing division that leads to whole numbers, however the "/" symbol is already used for creating multiple parentheses (See http://cosmicos.github.io/ Statistics and Structure) Any ideas?
Can you just use another symbol, like div
? If that's unappealing, I could substitute some other syntax for the role /
currently plays - the human-readable symbols are arbitrary in any case.
div
works fine for me. Thanks.
@aw1231 I recently freed up the /
symbol. So it is available for division if you need it now. Or div
is still fine.
Hi, I'm starting work again on this. But when I run make I get
mypath/transform/cosmicos/Vocab.hx:7: characters 12-45 : Class not found : Map
hey @aw1231, what version of haxe are you using? What does haxe -version
report?
haXe Compiler 2.07 - (c)2005-2011 Motion-Twin
Oh wait...I need at least 3. My bad.
Ok, now that I got a working build, I'm going to write my ideas about this. Real numbers need to be shown to be "the same" as the number system we currently have. For example:
x=0=0.0
Once that is established, I think it would be good to run it through the normal list of addition, subtraction, multiplication and division with equations that will result in non-decimal answers. Then on top of that, we can show how decimals work. Anything else I should add?
That sounds like a pretty good start @aw1231!
Do you think a new file is best for the source? Also, how exactly should I add a new "type" of number into the parsing system?
Wow my code needs documentation... I think you'd want to add Floats here https://github.com/paulfitz/cosmicos/blob/master/transform/cosmicos/Evaluate.hx#L28 and you'd want to add a case just before here https://github.com/paulfitz/cosmicos/blob/master/transform/cosmicos/Parse.hx#L145 that checks for a decimal and parses the string as a float if so.
Will do. Would opening a documentation issue sound ok?
Question: what style would you like the result to be in? Would 3.2 be ok as:
111.11
,using whatever symbol we decide a decimal to be. Addendum: What symbol should a decimal be?
+1 for a documentation issue. About how to represent a decimal: the easiest first step is to represent it in the message as something like (. v1 v2)
where .
is an imagined function that take two integer arguments and returns a float. I'd lean towards a significand/exponent representation https://en.wikipedia.org/wiki/Floating_point but haven't thought about it very deeply.
Here is my todo list as it stand right now:
Possible way to add it to the source:
I'm looking for a good book that describes things like these in a method similar to Euclid's Elements. Principia Mathematica by Whitehead and Russell looks like a good start. I think the best way to do this is to never have a number like 5.6 but rather always have it in exponent form.
Here is a question that I have that can go into the documentation: how do you code a new function/symbol for that function?
I think I got representing floats ok. I just don't know how to say .
for saying . 3 3
Bump.
Some ideas were added to the wiki: https://github.com/paulfitz/cosmicos/wiki#real-numbers
sorry for neglecting this issue @aw1231. The lesson plan sketched in the wiki seems plausible to me. So a start could be introducing floating point division, which can be done without having a way to directly represent floats in the message.
Hey @paulfitz! Sorry for neglecting on my end as well. (College makes programming hard) I'm going to build some lines of the message, run them by you, and then program them. (frac ...)
is first. It's been while since I read LINCOS so I'm planning on seeing if that's implemented there, and then I should have a good plan of attack.
Is this still happening? If not, I would like to pick this up.
That would be fine by me.
I did in the end need real numbers for a section about pi
and e
, so I put something together https://cosmicos.github.io/message.html#section18. There's still plenty of scope for adding material here.
@aw1231 mentions need for reals here: https://github.com/paulfitz/cosmicos/pull/2#issuecomment-47473166.