Skip to content

Commit

Permalink
Unlimit floating point decimals parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhmm authored and ElenaDDD committed Dec 19, 2023
1 parent 3475c79 commit cfb8711
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
44 changes: 24 additions & 20 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ RUN echo "sci-libs/fftw threads" >> /etc/portage/package.use/julia
RUN echo "dev-cpp/tbb -udev" > /etc/portage/package.use/tbb


RUN emerge --update dev-cpp/tbb -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update dev-cpp/tbb -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update dev-vcs/git -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update dev-vcs/git -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update -1o dev-util/cmake -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update -1o dev-util/cmake -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update dev-util/cmake -j1 && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update dev-util/cmake -j1 && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update kde-frameworks/extra-cmake-modules -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge -j`nproc` leveldb && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update kde-frameworks/extra-cmake-modules -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
RUN emerge -j`nproc` leveldb && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update \
app-arch/lz4 \
Expand All @@ -66,44 +66,48 @@ RUN emerge --update \
x11-libs/libXScrnSaver \
-j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

#RUN emerge --update dev-lang/julia -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
#RUN emerge --update dev-lang/julia -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

#RUN emerge -j`nproc` sys-devel/gcc && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge -j`nproc` sys-devel/gcc && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN (emerge --update sys-devel/clang:18 -j`nproc` || MAKEOPTS=-j1 emerge --update sys-devel/clang:18 -j1) && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge -v --onlydeps sys-devel/llvm:18 -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
RUN emerge -1 sys-devel/llvm:18 -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
RUN emerge -1u --onlydeps sys-devel/clang:18 -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
RUN emerge --update sys-devel/clang:18 -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
#RUN (emerge --update sys-devel/clang:18 -j`nproc` || MAKEOPTS=-j1 emerge --update sys-devel/clang:18 -j1) && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update =dev-libs/boost-1.82.0-r1 -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update =dev-libs/boost-1.82.0-r1 -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update \
lld \
-j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
-j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

#RUN emerge --update =dev-libs/boost-1.81.0 -j`nproc`

# FoundationDB deps
RUN emerge --update dev-cpp/benchmark dev-cpp/gtest -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update dev-lang/mono -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update dev-cpp/benchmark dev-cpp/gtest -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
RUN emerge --update dev-lang/mono -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update \
dev-util/intel-ocl-sdk \
-j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
-j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN emerge --update \
dev-util/vulkan-headers \
media-libs/vulkan-loader \
-j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
-j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

RUN eix-update

RUN emerge --update gdb -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
#RUN emerge --update dev-util/lldb -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update gdb -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
#RUN emerge --update dev-util/lldb -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*

#RUN emerge --update =dev-lang/julia-1.8.3-r4 -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
RUN emerge --update =dev-lang/julia-1.8.5-r1 -j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
#RUN emerge --update =dev-lang/julia-1.8.3-r4 -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
RUN emerge --update =dev-lang/julia-1.8.5-r1 -j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
#
RUN emerge --update \
app-misc/mc \
bash-completion \
eix \
sys-process/htop \
-j`nproc` && rm -rf /var/cache/distfiles && rm -rf /var/tmp/portage/*
-j`nproc` && rm -rf /var/cache/distfiles/* && rm -rf /var/tmp/portage/*
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// "cmake.configureSettings": {
// "CMAKE_BUILD_PARALLEL_LEVEL": "${nproc}",
// },
"cmake.generator": "Ninja",
"cmake.generator": "Ninja Multi-Config",
"extensions": [
"codeium.codeium",
"github.copilot",
Expand Down
9 changes: 6 additions & 3 deletions omnn/math/Valuable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,15 +659,18 @@ std::string Solid(std::string s) {
auto ss = s.substr(i, next - i);
Trim(ss);
auto hasSpace = ss.find(' ') != std::string::npos;
if (ss.find('.') != std::string::npos) {
auto dot = ss.find('.');
if (dot != std::string::npos) {
std::string s;
if(hasSpace){
s = ss;
s = Solid(s);
ss = s;
}
boost::multiprecision::cpp_dec_float_100 fp(ss);
o(Fraction(fp));
auto beforedot = ss.substr(0, dot);
auto afterdot = ss.substr(dot + 1);
auto f = Integer(beforedot) + Integer(afterdot) / (10_v ^ Integer(afterdot.length()));
o(std::move(f));
} else {
Valuable integer = hasSpace
? Integer(Solid(std::string(ss)))
Expand Down

0 comments on commit cfb8711

Please sign in to comment.