BookmarkSubscribeRSS Feed
danielpremisaac
Calcite | Level 5

 I am posting some code found on https://documentation.sas.com/doc/da/pgmsascdc/v_058/imlug/imlug_nonlinearoptexpls_sect003.htm

 

I am having trouble understanding the simple assignment statement shown in the example from the above web page . I am copying and pasting those lines below . Can someone here explain  what is 10. and 1. in the below assignment statements ? What does the '. ' signify ? Thanks a lot for answering . Where is the SAS official documentation explaining what that " . " does  ?

y1 = 10. * (x[2] - x[1] * x[1]);
   y2 = 1. - x[1];

 

 

4 REPLIES 4
Ksharp
Super User
As far as I know
10. is identity with 10
1. is identity with 1
maybe @Rick_SAS need say something .
danielpremisaac
Calcite | Level 5

Thank You for reading and answering .

Rick_SAS
SAS Super FREQ

The dot is a decimal point. In some languages such as FORTRAN, C, and Python, there is a difference between floating point numbers and integer numbers. The person who wrote this example was probably a programmer in one of these languages and was probably used to using decimal points to emphasize floating point computations.

 

SAS IML does not distinguish between numerical types. Every number is a double-precision floating point number. Thus, the example can also be written as 

y1 = 10 * (x[2] - x[1] * x[1]);
y2 = 1 - x[1];

 

danielpremisaac
Calcite | Level 5

Thank You for reading and answering . I was searching the SAS documentation for an answer , and I found none ! Its good to know , that it was probably something specific to this particular programmer who wrote this example.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 4 replies
  • 1056 views
  • 0 likes
  • 3 in conversation