Evaluating a floating point variable in Scheme language

后端 未结 2 525
眼角桃花
眼角桃花 2021-01-24 18:36

I want to read multiple data files (10 in total) in Ansys Fluent. I wrote a journal file which uses scheme language

(Do ((count 11.100 (+ count 0.100))) ((>=         


        
相关标签:
2条回答
  • 2021-01-24 19:05

    I think I have figured that out:

    data-~.3f.dat
    
    0 讨论(0)
  • 2021-01-24 19:16

    Try this:

    (do ((count 111/10 (+ count 1/10))) ((>= count 12))
      (ti-menu-load-string 
       (format #f "file read-data data-~2,3F.dat" count)))
    

    I assume format is from SRFI-48 Intermediate Format Strings. I've changed the numbers to rational numbers because adding 0.1 gives you rounding errors in floating point.

    0 讨论(0)
提交回复
热议问题