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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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