<commit_before>#ifndef __MIO_MATH_H__
#define __MIO_MATH_H__

#include <cmath>
#include <stdio.h>
#include <cfloat>

namespace sm{
  #define PI 3.14159265

  //wavenumbers (also called reciprocal centimeters, inverse centimeters or Kaisers), cm^{-1}
  template<typename T> inline T WavenumberToMicrometer(const T &wavenumber){ return(10000/wavenumber); }
  template<> inline float WavenumberToMicrometer(const float &wavenumber){ return(10000.0f/wavenumber); }
  template<> inline double WavenumberToMicrometer(const double &wavenumber){ return(10000.0/wavenumber); }

  template<typename T> inline T WavenumberToNanometer(const T &wavenumber){ return(10000000/wavenumber); }
  template<> inline float WavenumberToNanometer(const float &wavenumber){ return(10000000.0f/wavenumber); }
  template<> inline double WavenumberToNanometer(const double &wavenumber){ return(10000000.0/wavenumber); }

  inline int RoundToMultiple(const int &number, const int multiple){
    return (((number + multiple/2) / multiple) * multiple);<commit_msg>added round to nearest half function<commit_after>#ifndef __MIO_MATH_H__
#define __MIO_MATH_H__

#include <cmath>
#include <stdio.h>
#include <cfloat>

namespace sm{
  #define PI 3.14159265

  //wavenumbers (also called reciprocal centimeters, inverse centimeters or Kaisers), cm^{-1}
  template<typename T> inline T WavenumberToMicrometer(const T &wavenumber){ return(10000/wavenumber); }
  template<> inline float WavenumberToMicrometer(const float &wavenumber){ return(10000.0f/wavenumber); }
  template<> inline double WavenumberToMicrometer(const double &wavenumber){ return(10000.0/wavenumber); }

  template<typename T> inline T WavenumberToNanometer(const T &wavenumber){ return(10000000/wavenumber); }
  template<> inline float WavenumberToNanometer(const float &wavenumber){ return(10000000.0f/wavenumber); }
  template<> inline double WavenumberToNanometer(const double &wavenumber){ return(10000000.0/wavenumber); }

  inline float RoundNearestHalf(const float &value){
    return std::round(value*2.0f)*0.5f;
  }
  inline double RoundNearestHalf(const double &value){
    return std::round(value*2.0)*0.5;
  }

  inline int RoundToMultiple(const int &number, const int multiple){
    return (((number + multiple/2) / multiple) * multiple);
{'fraction_non_alphanumeric': 0.11198600174978128, 'fraction_numerical': 0.05074365704286964, 'mean_word_length': 6.353697749196141, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7336398', 'n_tokens_mistral': 821, 'n_tokens_neox': 719, 'n_words': 182}