On the one hand
On the one hand … this is great, quite literally.
But after searching Github, I’ve been unable to find the rest of the set. For example, what about three()? and what about constants, like pi()?
I understand that making all numbers overly complicated could take time, so what’s the ETA?
The beauty of five is that you can make any number you want.
Want three()? Well that's just
(five() * five() - five() - five()) / five() or (five() + five() + five())/five()
Want six()? five() + (five()/five())
Want zero()? five() - five()
@Joezo You left pi :stuck_out_tongue_winking_eye:
@dufferzafar we can estimate pi: ( (five() * five() ) - ( ( five() + five() + five() ) / five() ) ) / ( five() + ( ( five() + five() ) / five() ) )
@dufferzafar easiest way to get pi is through builtin Math object like this
var five = require('five');
Math[Buffer(((five() * five()) - (five() / five()) + ((five() * ((five() / five()) + (five() / five()))) * five() * five() * five()) * (five() - (five() / five())) + (five() * five())).toString(), 'hex').toString('utf8')]
#79
@shackpank I have tears in my eyes and my belly hurts from laughing. Far and away the best response ever made to any question ever asked in the history of GitHub.
May five() live forever :rocket:
Most numbers already have their own NPM packages!
This is just a few (not all of them have github repos)
Number packages
- For zero, use the
integer-value-positive-zeropackage like this and then require it and dozero() - For one, use
the-number-one. It's not a function so you just doone - For two, use the
twopackage and dotwo() - For three, use the
numeric-constant-threepackage and dothree() - For four, use the
always-fourpackage and dofour() - This package is for five.
- For six, use the
number-sixpackage and dosix() - For seven, use the
se7enpackage and doseven() - For eight, it's a bit different. You have to use the
eight-toolkitpackage and to get eight you doeightToolkit.constants.EIGHTor you can doconst eight = require('eight-toolkit').constants.EIGHTand then just writeeight - For nine, use the
value-ninepackage and donine() - For ten, it's not a function, use the
the-number-tenpackage and doten - For eleven, use the
elevenpackage and doeleven() - For twelve, use the
twlvpackage and dotwelve() - For thirteen, use the
always-thirteenpackage and dothirteen() - For 14, use the
fourteenpackage and dofourteen(it's not a function) - For 15, use the
number-fifteenpackage and dofifteen(also not a function) - For 16, use the
sixteen-constantpackage and dosixteen(not a function) - For 17, use the
seventeen-integerpackage and doseventeen()(a function) - For 18, use the
eighteen-positive-number-interactionspackage and doeighteen()(a function) - For 19, use the
nineteenifypackage and donineteenify() - For 20, use the
numbertwentypackage and dotwenty() - For 21, use the
always-21package and dotwentyone() - For 22, use the
twentytwopackage and dotwentytwo() - For 23, use the
twenty-three-toolspackage and dotwentyThreeTools.TWENTY_THREE(not a function) - For pi, require the
get-intrinsicpackage and doconst pi = GetIntrinsic("%Math.PI")and then to use pi dopi
Bonus: Other value packages
- For false use the FalseJS package made by me, or, if you prefer a simpler method, use the
falsepackage by MDE and import it and call itfand use it like this:f() - For true use the
truepackage by MDE, and import it astand use it like this:t() - For null use the
qc-corepackage and doqcCore.nullFn()for null. - For undefined use any noop function or use the
undefined-is-a-functionpackage and then runundefined()(for some reason you can name variables undefined in js) - For NaN use the
nan-is-a-functionpackage and then call it like this:_NaN()
If you want me to recommend any more packages, just ask!
Also you can use the solution by @Joezo but with jQuery like this:
require('vanilla-javascript')
require('vapor-js-npm')
require('none')()
global.jQuery = require('jquery')
require('jquery-basic-arithmetic-plugin')
const five = require('five')
// then to get three do:
const THREE = jQuery.divide(jQuery.subtract(jQuery.multiply(five(), five()), five() , five()), five())
for three u can use numeric-constant-three on npm numeric-constant-three