Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need real numbers #3

Open
paulfitz opened this issue Jun 30, 2014 · 25 comments
Open

need real numbers #3

paulfitz opened this issue Jun 30, 2014 · 25 comments

Comments

@paulfitz
Copy link
Owner

@aw1231 mentions need for reals here: #2 (comment).

@aw1231
Copy link
Collaborator

aw1231 commented Jul 8, 2014

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?

@paulfitz
Copy link
Owner Author

paulfitz commented Jul 8, 2014

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.

@aw1231
Copy link
Collaborator

aw1231 commented Jul 8, 2014

div works fine for me. Thanks.

@paulfitz
Copy link
Owner Author

@aw1231 I recently freed up the / symbol. So it is available for division if you need it now. Or div is still fine.

@aw1231
Copy link
Collaborator

aw1231 commented Sep 30, 2015

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

@paulfitz
Copy link
Owner Author

paulfitz commented Oct 3, 2015

hey @aw1231, what version of haxe are you using? What does haxe -version report?

@aw1231
Copy link
Collaborator

aw1231 commented Oct 5, 2015

haXe Compiler 2.07 - (c)2005-2011 Motion-Twin

@aw1231
Copy link
Collaborator

aw1231 commented Oct 5, 2015

Oh wait...I need at least 3. My bad.

@aw1231
Copy link
Collaborator

aw1231 commented Oct 5, 2015

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?

@paulfitz
Copy link
Owner Author

That sounds like a pretty good start @aw1231!

@aw1231
Copy link
Collaborator

aw1231 commented Nov 12, 2015

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?

@paulfitz
Copy link
Owner Author

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.

@aw1231
Copy link
Collaborator

aw1231 commented Nov 18, 2015

Will do. Would opening a documentation issue sound ok?

@aw1231
Copy link
Collaborator

aw1231 commented Nov 18, 2015

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?

@paulfitz
Copy link
Owner Author

+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.

@aw1231
Copy link
Collaborator

aw1231 commented Nov 19, 2015

Here is my todo list as it stand right now:

  • add exponent function
  • add negative numbers

Possible way to add it to the source:

  • addition (existing)
  • subtraction (existing)
  • negative
  • multiplication (existing)
  • exponent

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.

@aw1231
Copy link
Collaborator

aw1231 commented Nov 30, 2015

Here is a question that I have that can go into the documentation: how do you code a new function/symbol for that function?

@aw1231
Copy link
Collaborator

aw1231 commented Nov 30, 2015

I think I got representing floats ok. I just don't know how to say . for saying . 3 3

@aw1231
Copy link
Collaborator

aw1231 commented Jan 28, 2016

Bump.

@aw1231
Copy link
Collaborator

aw1231 commented Jul 1, 2016

Some ideas were added to the wiki: https://github.com/paulfitz/cosmicos/wiki#real-numbers

@paulfitz
Copy link
Owner Author

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.

@aw1231
Copy link
Collaborator

aw1231 commented Sep 29, 2016

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.

@dmkunsman
Copy link

Is this still happening? If not, I would like to pick this up.

@aw1231
Copy link
Collaborator

aw1231 commented Feb 14, 2019

That would be fine by me.

@paulfitz
Copy link
Owner Author

paulfitz commented Oct 5, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants