Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8522881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:15:10+00:00 2026-06-11T07:15:10+00:00

I am familiar with the Enumerable.Range method for generating an enumeration of values. But

  • 0

I am familiar with the Enumerable.Range method for generating an enumeration of values. But I would like something slightly different. I want to provide a min value, max value, and a number of desired points.

IE:

Method(double min, double max, int numberOfSteps)

taking

Method(0, 1000, 11);

would return

0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000

I figure for something like this, there must be a built-in method but my search hasn’t turned anything up. Am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:15:12+00:00Added an answer on June 11, 2026 at 7:15 am

    Other than the fact that you want the values to be double, everything else can be done with Enumerable.Range. I don’t think there’s anything built-in to do what you want, but it’s trivial to implement on top of Enumerable.Range:

    return Enumerable.Range(0, steps)
                     .Select(i => min + (max - min) * ((double)i / (steps - 1)));
    

    I’ve written that somewhat carefully so that you always end up with the final value. It does bork if you say you only want a single step though… you might want to guard against that and use Enumerable.Repeat(min, 1) in that case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im familiar with asp.net web forms. I would now like to move on to
I'm not familiar at all with the process behind this, but what I would
I'm familiar with MySQL but not with Firebird. I want to change my PHP
Apologies if this seems like I want my problem saved for me, but I
I'm familiar with C. Where I can write like this: uint array[0xFFFF][20]; But I've
I'm not familiar with wpf or C# language, but I want to generate xaml
I wanted to write an extension-method that would work on dictionaries whose values were
Anyone familiar with a way how can I can i write something to the
I am not very familiar with the OAuth flow and/or encoding, but I've managed
I am pretty familiar with jquery, but a novice at php, so excuse me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.