Thursday, November 3, 2016

Powershell v2 Scientific Notation Shortcut via mjolinor

While browing through one of mjoinors posts on Technet
For discussion - four different ways of creating a regex, and perf comparisons
I noticed an odd notation,
$counter = 1..1e6
Not sure what this I dropped it in Powershell, then, got the contents of $counter.  As it turns out 1e6 is 1 x 10 ^ 6 where 1 is the mantissa (or significand) and b id the exponent.  You can change each accordingly to get new values.  In short, this gives you the ability to do large numbers with small strings.  For more fun, check out the options you can consider by playing with scientific notation:
Scientific notation
This got me into a wild goose chase searching for all sorts of other easter eggs.  More posts to come.

Related Post:

0 comments:

Post a Comment

 
Copyright 2009 Information Blog
Powered By Blogger