packages feed

rev-scientific (empty) → 0.1.0.0

raw patch · 5 files changed

+106/−0 lines, 5 filesdep +base

Dependencies added: base

Files

+ CHANGELOG.md view
@@ -0,0 +1,7 @@+# Revision history for rev-scientific++## 0.1.0.0 -- 2023-06-22++* First version. Released on an unsuspecting world.++
+ Data/ReversedScientific.hs view
@@ -0,0 +1,35 @@++-- |+-- Module      :  Data.ReversedScientific+-- Copyright   :  (c) OleksandrZhabenko 2023+-- License     :  MIT+-- Stability   :  Experimental+-- Maintainer  :  oleksandr.zhabenko@yahoo.com+--+-- Provides a function that shows the somewhat "reversed" scientific notation of the big 'Integer' number so that it is easier (more likely exact) to compare at quick glance twe numbers in such a notation by their order and values.++{-# LANGUAGE NoImplicitPrelude #-}++{-# OPTIONS_HADDOCK -show-extensions #-}++module Data.ReversedScientific where++import GHC.Base+import GHC.Num ((-),Integer)+import Text.Show (Show(..))+import Data.List (length,dropWhileEnd)+++showBignum :: Int -> Integer -> String+showBignum n x +  | l0 < 6 = xShow+  | l >= n = mconcat ["e", show (l - 1), "~m", show l0, "~", k1s, ".", k2s, "...", k3s]+  | otherwise = xShow+      where xShow = show x+            l = length xShow+            k = dropWhileEnd (== '0') xShow +            l0 = length k+            f (p:q:r:s:t:u:v:vs) = f (p:q:r:t:u:v:vs)+            f (p:q:r:s:t:u:_) = ([p], [q, r], [s, t, u])+            (k1s,k2s,k3s) = f k+
+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2023 Oleksandr Zhabenko++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ README.md view
@@ -0,0 +1,10 @@+ Devotion+ ========++The author would like to devote this project to support the Foundation Gastrostars++If you would like to share some financial support, please, contact the foundation+using the URL:++[Contact Foundation GASTROSTARS](https://gastrostars.nl/hou-mij-op-de-hoogte)+
+ rev-scientific.cabal view
@@ -0,0 +1,34 @@+cabal-version:      2.4+name:               rev-scientific+version:            0.1.0.0++-- A short (one-line) description of the package.+synopsis:           A library to provide special kind of big numbers writing. ++-- A longer description of the package.+description:        Provides a function that shows the somewhat "reversed" scientific notation of the big 'Integer' number so that it is easier (more likely exact) to compare at quick glance two numbers in such a notation by their order and values.++-- A URL where users can report bugs.+-- bug-reports:++-- The license under which the package is released.+license:            MIT+license-file:       LICENSE+author:             Oleksandr Zhabenko+maintainer:         oleksandr.zhabenko@yahoo.com++-- A copyright notice.+copyright:          Oleksandr Zhabenko+category:           Data, Math+extra-source-files: CHANGELOG.md, README.md++library+    -- Modules included in this executable, other than Main.+    exposed-modules:  Data.ReversedScientific++    -- LANGUAGE extensions used by modules in this package.+    other-extensions: NoImplicitPrelude+    build-depends:    base >=4.13 && <5+    hs-source-dirs:   .+    default-language: Haskell2010+