GithubHelp home page GithubHelp logo

fastio's Introduction

fastio

fast input/output for competitive programming compatible with c++11 or greater

notes:

  • BUFSIZE must be at least 32 (but default is recommended)
  • Printer flushes automatically only when it is destroyed, so on interactive tasks you should automatically call .flush()
  • If an unsupported type is passed, the compiler will probabilly complain of it having no .begin() method
  • floating points are not 100% accurate

float accuracy:

  • tested with (no nan or inf, they're not supported):
    • 0,1,-1
    • 32768 binary random values st abs(val)<1e100 and abs(val)>1e-100
    • 32768 uniformly random values in (-1e3,1e3)
  • scan:
    • float: max_error: 0, avg_error: 0
    • double: max_error: 6.42353e-15, avg_error: 8.28241e-16
    • long double: max_error: 5.58098e-15, avg_error: 7.08416e-16
  • print:
    • float: max_error: 0, avg_error: 0
    • double: max_error: 0, avg_error: 0
    • long double: max_error: 3.51204e-17, avg_error: 6.9486e-18

Errors are calculated as abs(original value - new value)/abs(original value) (or simply new value if the original value was 0)

note that scanner cannot read floats with "e" notation and printer can only print floats with "e" notation

fastio's People

Contributors

myk00l avatar tpoppo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tpoppo

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.