Coder Social home page Coder Social logo

Comments (26)

johncbowman avatar johncbowman commented on July 24, 2024

Please post an example that demonstrates such an unsual behaviour, along with the platform and OS you are running under.

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

johncbowman avatar johncbowman commented on July 24, 2024

Could you please attach the Asymptote code and its output.

If by chance you are referring to the POSIX double remainder(double x, double y);
function that Asymptote gives you access to, you are using the wrong function. You want to use the integer
modulo operator % just like in C or C++. If you need integer division, use the operator #.

from asymptote.

johncbowman avatar johncbowman commented on July 24, 2024

P.S. Unlike in C and C++, Asymptote uses a portable implementation definition of %
so that the result has the same sign as the divisor.

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

johncbowman avatar johncbowman commented on July 24, 2024

Nothing got attached. Since your attachments are being rejected, maybe try inserting the code directly in the text box in code mode (apply <> to the region).

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

johncbowman avatar johncbowman commented on July 24, 2024

As I suspected, you are using real remainder(real, real) for integer arithmetic! That is a big no no in scientific computing, due to finite floating point precision. Use % instead.

Regarding "sys" there is no such Asymptote module; perhaps you are confusing Asymptote with Python.

Anyway, both sleep and usleep are available:

 asy
Welcome to Asymptote version 2.90-69 (to view the manual, type help)
> sleep
<void sleep(int seconds)>
> usleep
<void usleep(int microseconds)>
> 

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

johncbowman avatar johncbowman commented on July 24, 2024

Do you really need to know the absolute number of milliseconds after the epoch?
Isn't the nanosecond clock in cputime().parent.user or cputime().parent.clock sufficient?

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

johncbowman avatar johncbowman commented on July 24, 2024

https://asymptote.sourceforge.io/doc/Structures.html#index-cputime

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

johncbowman avatar johncbowman commented on July 24, 2024

What version of Asymptote are you using?

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

johncbowman avatar johncbowman commented on July 24, 2024

gswin64.exe is wrong; it should read gswin64c.exe
Did you override the default setting in your config.asy file, perhaps?

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

thejohnrainwater avatar thejohnrainwater commented on July 24, 2024

from asymptote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.