User talk:Ty8inf
From Wikipedia, the free encyclopedia
[edit] Comparison of programming languages (basic instructions)
How does S-Lang know when to use double precision? Mike92591 (talk) 04:22, 24 December 2007 (UTC)
It uses a set promotion rules, e.g., int+int=int, int+double=double, doublearray+int=doublearray, etc.
I mean how does S-Lang know when to use single or double precision? Mike92591 (talk) 04:51, 24 December 2007 (UTC)
The answer is the same: single+single=single, single+double=double, complex+double=complex, etc... S-Lang does not support single-precision complex, so there is no (stock) way of producing that.
Okay, is it possible to set the precision or is it implicitly set? Is "0.5" automatically a single? Is "√2" automatically a double? Mike92591 (talk) 05:45, 24 December 2007 (UTC)
There are several ways. Perhaps it is best to illustrate it inside slsh:
slsh> typeof(0.5); Double_Type slsh> typeof (0.5f); Float_Type slsh> d = 0.5; f = 0.5f; slsh> typeof (d+f); Double_Type slsh> typeof (2*f); Float_Type slsh> typeof (sqrt(d)); Double_Type slsh> typeof (sqrt(f)); Float_Type slsh> typeof (sin(f)); Float_Type slsh> typeof (sin(d)); Double_Type slsh> x = [1.0:2.0:0.01]; slsh> typeof (x); Array_Type slsh> _typeof(x); Double_Type slsh> typeof (sum(x)); Double_Type slsh> x = [1.0f:2.0f:0.01f]; slsh> typeof (sum(x)); Float_Type
I think I get it now, thanks. I must say though, that's pretty strange. Any idea of why it was done like that? Mike92591 (talk) 06:04, 24 December 2007 (UTC)
Why do you think it is strange? The language was designed for numerical scripting purposes and this paradigm is extremely convenient for quick numerical scripts.
The data type postfix thing just seems a little odd.Mike92591 (talk) 06:28, 24 December 2007 (UTC)
It's the same for C, where 0.5f represents a single precision float, 3L is a long integer, 3UL is an unsigned long, etc. S-Lang was written to be embedded into C programs and as such its syntax borrows a lot from C. S-Lang also supports complex numbers via 3+4i and 3+4j.
Hmm,I just tried that and you're right... still seems pretty strange lol. Mike92591 (talk) 17:33, 24 December 2007 (UTC)
[edit] Marking edits as 'minor'
I note that your recent edit to Comparison of programming languages (basic instructions) was marked as 'minor'. The Wikipedia description of 'minor' indicates that this flag is for truly minor changes such as a simple spelling correction or some simple re-arrangement without changing content. Some users have a preferences flag set so that they don't see minor edits when monitoring their watchlist. I don't disagree with the change you made, but I do feel that adding over 150 characters of text hardly classifies as 'minor'; perhaps you could consider this matter in future edits. Murray Langton (talk) 09:13, 17 January 2008 (UTC)
[edit] AfD nomination of List of programming languages by category
An editor has nominated List of programming languages by category, an article on which you have worked or that you created, for deletion. We appreciate your contributions, but the nominator doesn't believe that the article satisfies Wikipedia's criteria for inclusion and has explained why in his/her nomination (see also "What Wikipedia is not").
Your opinions on whether the article meets inclusion criteria and what should be done with the article are welcome; please participate in the discussion by adding your comments at Wikipedia:Articles for deletion/List of programming languages by category and please be sure to sign your comments with four tildes (~~~~).
You may also edit the article during the discussion to improve it but should not remove the articles for deletion template from the top of the article; such removal will not end the deletion debate. Thank you. BJBot (talk) 18:59, 26 March 2008 (UTC)